{{ template "base" . }}

{{ define "title" }}首页{{ end }}

{{ define "content" }}
    
    <section class="articles">
        <h2>最新文章</h2>
        
        {{ range .articles }}
        <article class="article-summary">
            <h3><a href="/article/{{ .Slug }}">{{ .Title }}</a></h3>
            <p class="meta">
                <time datetime="{{ .CreatedAt.Format "2006-01-02" }}">
                    {{ .CreatedAt.Format "2006年01月02日" }}
                </time>
            </p>
            <p>{{ .Excerpt }}</p>
            <a href="/article/{{ .Slug }}" class="read-more">阅读更多</a>
        </article>
        {{ else }}
        <p>暂无文章</p>
        {{ end }}
    </section>
{{ end }}